﻿(function () {
    $(function () {
        var _retrospectService = abp.services.app.retrospect;


        //导出为excel文档
        $('#btn-query').click(function () {
            layer.load(0, {
                shade: [0.3, '#000'] //0.1透明度的白色背景
            });


            $.post("/Retrospects/GetRetrospect", {
                seatID: $("#seatID").val()
            },
                function (result) {
                    if (result.result.length > 0) {
                        if (result.result[0].seatID != null && result.result[0].seatID != "") {
                            document.getElementById("_seatID").innerText = result.result[0].seatID;
                        }
                        else {
                            document.getElementById("_seatID").innerText = "无";
                        }
                        if (result.result[0].backrestAssemblyNo != null && result.result[0].backrestAssemblyNo != "") {
                            document.getElementById("backrestAssemblyNo").innerText = result.result[0].backrestAssemblyNo;
                        }
                        else {
                            document.getElementById("backrestAssemblyNo").innerText = "无";
                        }
                        if (result.result[0].cushionAssemblyNo != null && result.result[0].cushionAssemblyNo != "") {
                            document.getElementById("cushionAssemblyNo").innerText = result.result[0].cushionAssemblyNo;
                        }
                        else {
                            document.getElementById("cushionAssemblyNo").innerText = "无";
                        }
                        if (result.result[0].buckleNo != null && result.result[0].buckleNo != "") {
                            document.getElementById("buckleNo").innerText = result.result[0].buckleNo;
                        }
                        else {
                            document.getElementById("buckleNo").innerText = "无";
                        }
                        if (result.result[0].slideNo != null && result.result[0].slideNo != "") {
                            document.getElementById("slideNo").innerText = result.result[0].slideNo;
                        }
                        else {
                            document.getElementById("slideNo").innerText = "无";
                        }
                        if (result.result[0].sabNo != null && result.result[0].sabNo != "") {
                            document.getElementById("SABNo").innerText = result.result[0].sabNo;
                        }
                        else {
                            document.getElementById("SABNo").innerText = "无";
                        }
                        if (result.result[0].backrestSkin != null && result.result[0].backrestSkin != "") {
                            document.getElementById("backrestCoverNo").innerText = result.result[0].backrestSkin;
                        }
                        else {
                            document.getElementById("backrestCoverNo").innerText = "无";
                        }

                        if (result.result[0].cushionSkin != null && result.result[0].cushionSkin != "") {
                            document.getElementById("cushionCoverNo").innerText = result.result[0].cushionSkin;
                        }
                        else {
                            document.getElementById("cushionCoverNo").innerText = "无";
                        }

                        if (result.result[0].backPlaneNo != null && result.result[0].backPlaneNo != "") {
                            document.getElementById("backPlaneNo").innerText = result.result[0].backPlaneNo;
                        }
                        else {
                            document.getElementById("backPlaneNo").innerText = "无";
                        }

                        if (result.result[0].headrestNo != null && result.result[0].headrestNo != "") {
                            document.getElementById("headrestNo").innerText = result.result[0].headrestNo;
                        }
                        else {
                            document.getElementById("headrestNo").innerText = "无";
                        }

                        if (result.result[0].headrestNo1 != null && result.result[0].headrestNo1 != "") {
                            document.getElementById("headrestNo1").innerText = result.result[0].headrestNo1;
                        }
                        else {
                            document.getElementById("headrestNo1").innerText = "无";
                        }

                        if (result.result[0].centerHeadrestNo != null && result.result[0].centerHeadrestNo != "") {
                            document.getElementById("centerHeadrestNo").innerText = result.result[0].centerHeadrestNo;
                        }
                        else {
                            document.getElementById("centerHeadrestNo").innerText = "无";
                        }
                        if (result.result[0].armRestNo != null && result.result[0].armRestNo != "") {
                            document.getElementById("armRestNo").innerText = result.result[0].armRestNo;
                        }
                        else {
                            document.getElementById("armRestNo").innerText = "无";
                        }
                    }
                    else {
                        document.getElementById("_seatID").innerText = "无";
                        document.getElementById("backrestAssemblyNo").innerText = "无";
                        document.getElementById("cushionAssemblyNo").innerText = "无";
                        document.getElementById("buckleNo").innerText = "无";
                        document.getElementById("slideNo").innerText = "无";
                        document.getElementById("SABNo").innerText = "无";
                        document.getElementById("backrestCoverNo").innerText = "无";
                        document.getElementById("cushionCoverNo").innerText = "无";
                        document.getElementById("backPlaneNo").innerText = "无";
                        document.getElementById("headrestNo").innerText = "无";
                        document.getElementById("headrestNo1").innerText = "无";
                        document.getElementById("centerHeadrestNo").innerText = "无";
                        document.getElementById("armRestNo").innerText = "无";
                    }

                    

                    layer.closeAll('loading');
                });









            //_retrospectService
            //    .getRetrospect({
            //        seatID: $("#seatID").val()
            //    })
            //    .done(function (result) {
            //        layer.closeAll('loading');
            //        if (result[0].seatID != null) {
            //            document.getElementById("_seatID").innerText = result[0].seatID;
            //        }
            //        if (result[0].backrestAssemblyNo != null) {
            //            document.getElementById("backrestAssemblyNo").innerText = result[0].backrestAssemblyNo;
            //        }
            //        if (result[0].cushionAssemblyNo != null) {
            //            document.getElementById("cushionAssemblyNo").innerText = result[0].cushionAssemblyNo;
            //        }
            //        if (result[0].buckleNo != null) {
            //            document.getElementById("buckleNo").innerText = result[0].buckleNo;
            //        }
            //        if (result[0].slideNo != null) {
            //            document.getElementById("slideNo").innerText = result[0].slideNo;
            //        }
            //        if (result[0].SABNo != null) {
            //            document.getElementById("SABNo").innerText = result[0].SABNo;
            //        }
            //        if (result[0].backrestCoverNo != null) {
            //            document.getElementById("backrestCoverNo").innerText = result[0].backrestCoverNo;
            //        }
            //        if (result[0].cushionCoverNo != null) {
            //            document.getElementById("cushionCoverNo").innerText = result[0].cushionCoverNo;
            //        }
            //    });
        });


        //$("#btn-query").click(function () {
        //    var _line = document.getElementById("lineId").value;
        //    var _seatType = document.getElementById("seatTypeId").value;
        //    var _stationNo = document.getElementById("stationNoId").value;
        //    var _date = document.getElementById("time1").value;

        //    document.getElementById("line").innerText = _line;
        //    document.getElementById("seatType").innerText = _seatType;
        //    document.getElementById("stationNo").innerText = _stationNo;
        //    document.getElementById("date").innerText = _date;

        //    //_atlasService.tb_DataSource({});
        //    $.post("/AtlasCpks/tb_DataSource", {
        //        LineId: _line,
        //        StationNoId: _stationNo,
        //        SeatTypeId: _seatType,
        //        Time1: document.getElementById("time1").value,
        //        Time2: document.getElementById("time2").value
        //    },
        //        function (result) {

        //            //$("#div_Content").html(result);
        //            //innerHTML  html 要大写 
        //            document.getElementById("div_Content").innerHTML = result.lststr[0];
        //            document.getElementById("explain2").innerHTML = result.lststr[1];
        //            document.getElementById("chart1up").innerHTML = result.lststr[2];
        //            document.getElementById("chart2up").innerHTML = result.lststr[3];
        //            option1.series = result.series[0];
        //            //option1.legend.data = result[1].legend;
        //            //option1.grid = result[1].grid;
        //            myChart1.hideLoading();
        //            myChart1.setOption(option1);

        //            option2.series = result.series[1];
        //            //option1.legend.data = result[1].legend;
        //            //option1.grid = result[1].grid;
        //            myChart2.hideLoading();
        //            myChart2.setOption(option2);
        //        });
        //});



    });
})();
